//
//  Block.h
//  CarDemo
//
//  Created by huang kun on 8/10/10.
//  Copyright 2010 UESTC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "cocos2d.h"
#import "Constant.h"

typedef enum {
	kblockTypeDefault,
	kblockType1 = 1,
	kblockType2,
	kblockType3,
	kblockType4,
	kblockType5,
}BlockType;


@interface NextBlock : CCSprite 
{
	int type;
}
@property (nonatomic, assign) int type;

@end

@class Block;
@protocol BlockDelegate<NSObject>

- (void) updateBlock:(Block *)block;

@end


@interface Block : NextBlock <CCTargetedTouchDelegate>{
	BOOL up;		//方向连通？
	BOOL down;
	BOOL left;
	BOOL right;
	BOOL connect;	//整体连通？
	BOOL isTouchEnable;
	
	id<BlockDelegate> delegate;
}

@property (nonatomic, assign) BOOL connect;
@property (nonatomic, assign) id<BlockDelegate>delegate;
@property BOOL isTouchEnable;

+ (id) blockWithType:(int)t;
- (id) initWithType:(int)t;

- (void) rotate;
- (BlockShape) getBlock;

@end
